//author:kakake
class tsotcdrugController {
    public data = {
        dbConn: TSLobsterAPI.Program.GetDbConn()
    }

    getotcdrugs() {

        var drugname = TSLobsterAPI.Program.RequestQuery('drugname', ''),
        var pageInfo = {
            key: "药品名称",
            page: TSLobsterAPI.Program.RequestQuery('page', 0),
            perPage: TSLobsterAPI.Program.RequestQuery('limit', 10),
            totalRecord: 0,
            totalPage: 0
        }

        var dbparams = {
            drugname: '%' + drugname + '%'
        }

        var strsql = "SELECT 药品名称,药品规格 ,药品类型,OTC类别,备注 FROM 中国OTC目录库 where 药品名称 like @drugname ";
        var list = TSLobsterAPI.DbHelper.DbGetJsonData(this.data.dbConn, strsql, dbparams, pageInfo);

        return { list: list, count: pageInfo.totalRecord };
    }
}